﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ProjectBase.Core;
using ProjectBase.Core.Web;
using ProjectBase.Mvc;

using $prjsn$.Common;
using $prjsn$.Entity.Services.HowTos;

namespace $safeprojectname$.Restrictions
{
    [CLSCompliant(false)]
    public class ComplexEntityFilterHandler : FilterRestrictionHandler<ComplexEntityFilter>
    {
        protected override void Handle(ComplexEntityFilter filter)
        {
            // TODO just an example
            var showSpecialToAdmin = SecurityManager.User.CurrentRole.IsEqual("Administrator")
                && filter.Code.IsEmpty();

            if (showSpecialToAdmin)
            {
                filter.Code = "C*";
            }
        }
    }
}
